﻿using System;
using Windows.UI.Xaml.Controls;
using Template10.Controls;
using Template10.Services.NavigationService;
using SQLite.Net;
using Wasion.HHU.Data;
using Wasion.HHU.ViewModels;
using Windows.Networking.Sockets;
using Wasion.HHU.Services;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace Wasion.HHU.Views
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class Shell : Page
    {
        public static Shell Instance { get; set; }
        public static HamburgerMenu HamburgerMenu => Instance.MyHamburgerMenu;
        public static SQLiteConnection conn = new DbConn().Connection;
        public static UserViewModel User = new UserViewModel();
        public static BluetoothService BluetoothService;
        public static MeterManager MeterManager = null;
        public static ViewModels.Meter Meter = null;

        public Shell()
        {
            Instance = this;
            InitializeComponent();

            
            MeterManager = new MeterManager();
            Meter= MeterManager.CreateMeter();
            User.IsLogin = true;
            
        }

        public Shell(INavigationService navigationService) : this()
        {
            SetNavigationService(navigationService);
        }

        public void SetNavigationService(INavigationService navigationService)
        {
            MyHamburgerMenu.NavigationService = navigationService;
        }

        private void MyHamburgerMenu_OnPaneClosed(object sender, EventArgs e)
        {
        }
    }

    public enum NotifyType
    {
        StatusMessage,
        ErrorMessage
    };
}
